<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@include file="/common/common.jspf"%>
    <link rel="stylesheet" href="${ctx}/js/date/bootstrap_select.min.css">
    <script src="${ctx}/js/date/bootstrap_select.min.js"></script>

<script type="text/javascript" src="${ctx}/js/system/user/add.js">
	
</script>
<style type="text/css">
.col-sm-3 {
    position: relative;
	width: 15%;
	float: left;
	text-align: right;
}

.col-sm-9 {
	width: 32%;
	float: left;
	text-align: left;
}

label[class^="btn btn-default"] {
	margin-top: -4px;
}
</style>
</head>
<body>
	<div class="l_err" style="width: 100%; margin-top: 2px;"></div>
	<form id="form" name="form" class="form-horizontal" method="post" action="${ctx}/order/editOrder.shtml">
		<input type="hidden" class="form-control" value="${user.ofid}"
			   name="orderFormMap.ofid" id="ofid">

		<input type="hidden" name="orderFormMap.stockid" id="stockid" value="${user.stockid}">
		<%--<input type="hidden" value="${user.edemid}" name="orderFormMap.edemid" id="edemid" >--%>

		<section class="panel panel-default">
		<div class="panel-body">
			<div class="form-group">
				<div class="col-sm-3">
					<label class="control-label">订单编号</label>
				</div>
				<div class="col-sm-9">
					<input type="text" class="form-control"
						   name="orderFormMap.ofcode" id="ofcode" value="${user.ofcode}" readonly = readonly>

				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label">编制人</label>
					<div class="col-sm-9">
                        <select class="form-control selectpicker show-tick" data-live-search="true" name="orderFormMap.edemid" id="edemid" >
                            <c:forEach items="${emp}" var="emps">
                                <c:choose>
                                    <c:when test="${emps.empId == user.edemid}">
                                        <option value="${emps.empId}" selected = "selected">${emps.empName}</option>
                                    </c:when>
                                    <c:otherwise>
                                        <option value="${emps.empId}">${emps.empName}</option>
                                    </c:otherwise>
                                </c:choose>
                            </c:forEach>
                        </select>
						<%--<input type="text" class="form-control" value="${user.empName}"--%>
							   <%--id="edemids">--%>
						<%--<span class="input-group-btn">--%>
							<%--<button class="btn btn-info" id="ede" type="button"--%>
									<%--style="height: 34px; position: absolute; top: -34px; left: 210px;"--%>
									<%--onclick="emp();">--%>
								<%--<span class="glyphicon glyphicon-search"></span>--%>
							<%--</button>--%>
					<%--</span>--%>
					</div>
				</div>
			</div>

			<div class="form-group">
                <label class="col-sm-3 control-label">订单数量</label>
                <div class="col-sm-9">
                    <input type="text" class="form-control" name="orderFormMap.num" id="num" value="${user.num}">
                </div>

				<div class="form-group">
					<label class="col-sm-3 control-label">订单状态</label>
					<div class="col-sm-9">
						<select class="form-control" name="orderFormMap.billstateid" id="billstateid">
                            <option value="1" <c:if test="${user.billstateid == 1}">selected</c:if> >完成</option>
							<option value="2" <c:if test="${user.billstateid == 2}">selected</c:if>>未完成</option>
							<option value="3" <c:if test="${user.billstateid == 3}">selected</c:if>>下达</option>
							<option value="4" <c:if test="${user.billstateid == 4}">selected</c:if>>等待</option>
							<option value="5" <c:if test="${user.billstateid == 5}">selected</c:if>>计划</option>
                            <option value="6" <c:if test="${user.billstateid == 6}">selected</c:if>>生产中</option>
						</select>
					</div>
				</div>
			</div>


			<div class="form-group">
				<label class="col-sm-3 control-label">成品名称</label>
				<div class="col-sm-9">
					<input type="text" class="form-control"
						   name="orderFormMap.stockname" id="stockname" value="${user.stockname}" readonly="readonly">
					<%--<span class="input-group-btn">--%>
							<%--<button class="btn btn-info" id="workorder" type="button"--%>
									<%--style="height: 34px; position: absolute; top: -34px; left: 230px;"--%>
									<%--onclick="getItemBom('stockid','name');">--%>
								<%--<span class="glyphicon glyphicon-search"></span>--%>
							<%--</button>--%>
					<%--</span>--%>
				</div>

                <div class="form-group">
                    <label class="col-sm-3 control-label">生产车间</label>
					<div class="col-sm-9">
                        <select class="form-control" name="orderFormMap.workshopId" id="workshopId" >
							<c:forEach items="${dep}" var="d">
								<c:choose>
									<c:when test="${d.deid == user.workshopId}">
										<option value="${d.deid}" selected = "selected">${d.dename}</option>
									</c:when>
									<c:otherwise>
										<option value="${d.deid}">${d.dename}</option>
									</c:otherwise>
								</c:choose>
							</c:forEach>
                        </select>
						<%--<input type="text" class="form-control" value="${user.clientComName}"--%>
							   <%--id="clientids">--%>
						<%--<span class="input-group-btn">--%>
							<%--<button class="btn btn-info" id="tbc" type="button"--%>
									<%--style="height: 34px; position: absolute; top: -34px; left: 210px;"--%>
									<%--onclick="client();">--%>
								<%--<span class="glyphicon glyphicon-search"></span>--%>
							<%--</button>--%>
					<%--</span>--%>
					</div>
                </div>
			</div>



			<div class="form-group">
				<label class="col-sm-3 control-label">订购日期</label>
				<div class="col-sm-9">
					<input type="date" class="form-control"
						   name="orderFormMap.btime"
						   id="btime" value="${user.btime}">
				</div>

				<div class="form-group">
					<label class="col-sm-3 control-label">要求日期</label>
					<div class="col-sm-9">
						<input type="date" class="form-control"
							   name="orderFormMap.etime"
							   id="etime" value="${user.etime}">
					</div>
				</div>
			</div>

			<div class="line line-dashed line-lg pull-in"></div>
			<footer class="panel-footer text-right bg-light lter">
			<button type="submit" class="btn btn-success btn-s-xs">提交</button>
			</footer>
			</div>
		</section>
	</form>
	<script type="text/javascript" src="${ctx}/js/public/public.js"></script>
	<script type="text/javascript">
        $(document).ready(function(){
            $('select').selectpicker();
        });
		onloadurl();

        function inser_data(data1, data2) {
            $("#stockid").val(data1);
            $("#stockname").val(data2);
        }

		// function inser_data_emp(data1, data2) {
		// 	$("#edemids").val(data1);
		// 	$("#edemid").val(data2);
		// }
	</script>
	<script type="text/javascript"
		src="${ctx}/notebook/notebook_files/bootstrap-filestyle.min.js"></script>
</body>
</html>